package main

import (
	"algorithm-go/trie"
	"fmt"
)

func main() {
	dirtyWords := []string{"badword", "uglyword"} // 假设的脏字
	text := "This is a badword and an uglyword example."

	// 构建Trie树
	t := trie.NewTrie()
	for _, word := range dirtyWords {
		t.Insert(word)
	}

	// 过滤脏字
	result := trie.FilterDirtyWords(text, t, '*')
	fmt.Println(result)
}
